package com.example.app;

import com.alibaba.druid.pool.DruidDataSource;
import com.example.bean.Dog;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class app1 {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext2.xml");
        Object cat = applicationContext.getBean("cat");
        Dog dog = applicationContext.getBean(Dog.class);
        DruidDataSource dataSource = applicationContext.getBean("dataSource", DruidDataSource.class);
        System.out.println(cat);
        System.out.println(dog);
        System.out.println(dataSource);
    }
}
